Skip to main content

iOS Firebase Configration

Setting up Firebase for your HandyHue App Project with iOS.

Add iOS App With The Package Name In Firebase Console:

  1. On the Firebase console, click the iOS icon.

Docusaurus logo

  1. Enter Package Name (e.g., com.example.userApp) and click on register app.

Docusaurus logo

  1. After registering the app, you will receive the GoogleService-Info.plist, download it. Otherwise you can download later after add Gogole login and push notification configration in firebase project so google login and push notification will work with your project. Check below how to add SHA in fribase

Docusaurus logo

How to add Google SignIn in iOS Flutter Project:

To enable Google SignIn in your app:

  • Make Sure that your app on Firebase like above steps.

  • Make sure that GoogleService-Info.plist is the name of the file you downloaded from Firebase.

  • Add the following CFBundleURLTypes attributes into the [My_project]/ios/Runner/Info.plist file.

        <key>CFBundleURLTypes</key>
    <array>
    <dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleURLSchemes</key>
    <array>
    <!-- Replace this value with the REVERSED_CLIENT_ID copied from GoogleService-Info.plist -->
    <string>Enter your REVERSED_CLIENT_ID</string>
    </array>
    </dict>
    </array>

Generate .p8 APNs Authentication Key from Apple Developer Account

Important

A .p8 certificate (also known as an Apple Push Notification Service (APNs) Authentication Key) is required to send push notifications to iOS devices. This certificate is essential because it allows your server or push notification provider (e.g., Firebase) to authenticate with Apple’s APNs (Apple Push Notification Service) and securely deliver notifications to iOS apps.

  1. Log in to App Store Connect.

  2. Click Certificates, Identifiers & Profiles.

  3. Go to Keys → Click the "+" (Create a new key) button..

  4. Enter a key name (e.g., FCM Push Key).

  5. Enable "Apple Push Notifications service (APNs)" and click Continue.

  6. Click Register and Download the .p8 file (It will contain a Key ID).

Important

You can download the .p8 file only once, so store it securely!

  1. Note your Key ID and Team ID (found in Apple Developer → Membership section).

Now Let's Add .p8 Certificate in Firebase

  1. Go to Firebase Console

  2. Select your iOS app.

  3. In the left sidebar, go to Project Settings (⚙️) → Cloud Messaging.

  4. Under iOS app configuration, find APNs Authentication Key and click Upload.

  5. Upload your .p8 file and enter the required details:

    • Key ID (from the Apple Developer account).
    • Team ID (from your Apple Developer Membership).
    • Bundle ID (of your iOS app).
  6. Click Save.

Now Let's add firebase generated info.plist in iOS Flutter Project:

  1. Open Xcode on your Mac computer.

  2. Navigate to the directory of your Flutter project on your computer.

  3. Inside your Flutter project directory, locate the ios folder and open it.

  4. Look for a file with the extension .xcworkspace within the ios folder. This file represents your Xcode project for the Flutter app.

  5. Select the .xcworkspace or .xcodeproj file and click on the "Open" button.

  6. Drag and drop GoogleService-Info.plist under info.plist.

Docusaurus logo

Enable Push Notifications in Xcode

  1. Open your Xcode project.

  2. Go to Signing & Capabilities tab.

  3. Click "+ Capability" and add Push Notifications and Background Modes (Enable "Remote Notifications").

  4. Ensure your app's Bundle Identifier matches the one in Firebase & Apple Developer.

Test Push Notifications

  1. Run your app on a real iOS device (Push notifications don't work on simulators).
  2. Send a test notification from Firebase Console:
    • Go to Cloud MessagingNew Notification → Select your iOS app.
    • Click Send Test Message and enter a valid FCM token (from logs or app).
🚀 Done! Now Firebase can send push notifications to your iOS app using APNs. 🎉

If you face issues, check Firebase logs and APNs authentication errors in Firebase Cloud Messaging settings.

Successful !!

Great! You have successfully configured the iOS App Firebase for Push Notificationa and Google Social Login!